package com.javaziliao.design.dprecated.observer;

import com.javaziliao.design.dprecated.DeprecatedConstants;
import com.javaziliao.design.dprecated.state.DeprecatedAbstractOrderState;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class DeprecatedReceiveObserver extends DeprecatedAbstractObserver {
    @PostConstruct
    public void init() {
        DeprecatedConstants.OBSERVER_LIST.add(this);
    }
    @Override
    public void orderStateHandle(String orderId, String orderState) {
        if (!DeprecatedAbstractOrderState.ORDER_FINISH.equals(orderState)){
            return;
        }
        System.out.println("ORDER_FINISH!!");
    }
}
